#include "yuvspec.h"

YUVSpec::YUVSpec():YUVSpec(0,0,0,AV_PIX_FMT_NONE)
{

    _imageSize = 0;
}

YUVSpec::YUVSpec(int width, int height, int fps, AVPixelFormat format):
    _width(width),_height(height),_fps(fps),_format(format)
{

    _imageSize = av_image_get_buffer_size(format,width, height, 1);
}

int YUVSpec::getWidth() const
{

    return _width;
}

int YUVSpec::getHeight() const
{

    return _height;
}

int YUVSpec::getFPS() const
{

    return _fps;
}

int YUVSpec::getImageSize() const
{

    return _imageSize;
}

void YUVSpec::setWidth(int width)
{
    _width = width;
}

void YUVSpec::setHeight(int height)
{
    _height = height;
}

void YUVSpec::setFPS(int fps)
{
    _fps = fps;
}

void YUVSpec::setFormat(AVPixelFormat format)
{
    _format = format;
}

void YUVSpec::reCalImageSize()
{

    _imageSize = av_image_get_buffer_size(_format,_width, _height, 1);

}

